<template>
	<view>
		<u-navbar :title="title" is-fixed
			background="url('https://www.yplm888.com//uploads/20220803/7ed305f9a93ba50b049a7725662b18cc.png') no-repeat">
		</u-navbar>
		
		<scroll-view scroll-y="true" :style="'height:' + scrollH+'rpx;'">
			<u-parse style='margin: 20rpx 20rpx;' :html="content"></u-parse>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				scrollH: 0,
				content:''
			}
		},
		async onLoad(option) {
			await this.getDetail(option.id)
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					that.scrollH = res.windowHeight * 750 / res.windowWidth;
					// #ifdef MP-WEIXIN
					that.scrollH = res.windowHeight * 750 / res.windowWidth - parseInt(res.safeArea.top) - that.hightMore;
					// #endif
				}
			});
		},
		onReady() {
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					that.scrollH = res.windowHeight * 750 / res.windowWidth;
					// #ifdef MP-WEIXIN
					that.scrollH = res.windowHeight * 750 / res.windowWidth - parseInt(res.safeArea.top) - 100;
					// #endif
				}
			});
		},
		methods: {
			getDetail(id) {
				this.$u.api.getArticleDetail({id}).then(async res => {
					this.content = res.data.content;
					this.title = res.data.title;
					// this.isCollect = res.data.is_collection
					// this.hightMore = this.junshiInfo.ProductLst?.length>0?1150:900
				})
			}
		}
	}
</script>